package controller;

import com.sinopac.mapper.Users;
import com.sinopac.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * @author dell
 */
@Controller
@RequestMapping("/Users")
public class UsersController {

    @Autowired
    private UsersService usersService;

    @RequestMapping("/addUsers")
    public String addUser(Users users) {
        this.usersService.insertUsers(users);
        return "addUsersSuccessful";
    }

//    @RequestMapping("/`getUsers`")
//    public ModelAndView getUserByName(Integer userId) {
//        ModelAndView modelAndView = new ModelAndView();
//        Users Users = this.UsersService.getUsersById(userId);
//        modelAndView.addObject("Users", Users);
//        modelAndView.setViewName("getUsersSuccessful");
//        return modelAndView;
//    }
}
